home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 015 / cprint44.arc / CPRINT.DOC next >
Encoding:
Text File  |  1986-09-24  |  9.9 KB  |  276 lines

  1.     CPRINT.EXE IS A PROGRAM SOURCE CODE AND ASCII FILE PRINTING UTILITY.
  2.  
  3.     CPRINT  can  take  input  from  the command line or via a built in full
  4.     screen editor.  Enter "CPRINT /P" for full screen input mode.
  5.  
  6.     CPRINT can INTELLIGENTLY handle a print request for MULTIPLE files such
  7.     that the files are CORRECTLY printed on BOTH sides of the paper.   This
  8.     is great for printing hardcopy of large documents (eg.  PROCOMM.DOC) or
  9.     many  small  files (eg.  source code for your 200 function C lib).  The
  10.     resulting output is arranged just like a book - page 1 & 2 of the first
  11.     file are on opposite sides of the same piece of paper.
  12.  
  13.     CPRINT will page break when the  default  line  count  is  reached  (/L
  14.     switch)  or when it encounters an ASCII form feed in the file.  You can
  15.     add a top margin (great for EPSON printers).   You  can  print  or  not
  16.     print  the files date & time info as a page header.  You can add a left
  17.     margin to all lines of the file (allows 3 hole punch  without  punching
  18.     through text).
  19.  
  20.  
  21.     File List
  22.     ---------
  23.  
  24.     The distribution files are:
  25.  
  26.       CPRINT.DOC  - this documentation file.
  27.  
  28.       CPRINT.EXE  - the full program including the built in full
  29.                     screen editor.
  30.  
  31.       CPRINTS.EXE - a small version of cprint without the full screen
  32.                     editor - for use on pc's which are not close IBM
  33.                     compatibles.
  34.  
  35.  
  36.     Program Usage
  37.     -------------
  38.  
  39.       cprint  filespec switches
  40.  
  41.  
  42.     OPTIONAL COMMAND LINE SWITCHES: ( where "xx" equals a number)
  43.  
  44.       /P    display prompts using the built in full screen editor
  45.             so you can enter options by "filling in the blanks".
  46.  
  47.       /Mxx  defines left margin to add to every print line (default=0).
  48.  
  49.       /Wxx  defines total maximum line width (default=80).
  50.  
  51.       /Cxx  defines number of copies to print (default=1).
  52.  
  53.       /H    do NOT print files' date/time info as page header.
  54.             useful for printing pre-formatted documents.
  55.  
  56.       /Txx  defines top margin to add (default=0).
  57.  
  58.       /Lxx  defines maximum print lines per page in addition to
  59.             the top margin (default=54  (66 if /H used)).
  60.  
  61.       /1    print pages which go on front side of paper  (see NOTES).
  62.  
  63.       /2    print pages which go on back side of paper  (see NOTES).
  64.  
  65.       /S    split such that each file is on a unique set of pages.
  66.             (do NOT print the first page of a new file on the back
  67.              of the last page of the previous file.)
  68.  
  69.  
  70.      NOTES:
  71.  
  72.        Filespec may contain pathnames & wildcards.
  73.  
  74.        To print on both sides of paper:
  75.           print with /1, turn the paper over, re-print with /2.
  76.  
  77.        /S only applies to /1 and /2.
  78.  
  79.        /C is disabled by /1 and /2.
  80.  
  81.  
  82.     Some Examples
  83.     -------------
  84.  
  85.         Print files with file date & time info as page heading, 54
  86.         text lines per page, using front of paper only.
  87.  
  88.            CPRINT D:\LC\USER\SRC\*.C
  89.  
  90.  
  91.         Same as above but add an 8 character left margin and print on both
  92.         sides of the paper (put your printer in 12 CPI mode first).
  93.  
  94.            CPRINT D:\LC\USER\SRC\*.C /M8 /W88 /1
  95.  
  96.              when  1st  pass  printout  is  completed  flip paper over then
  97.              enter:
  98.  
  99.            CPRINT D:\LC\USER\SRC\*.C /M8 /W88 /2
  100.  
  101.  
  102.     Notice in the second example I told CPRINT to use an 88 character  line
  103.     width.  The default width is 80.  If the total print width (left margin
  104.     +  text)  is  greater than the /W parameter CPRINT will break the line,
  105.     linefeed, space over by the left margin amount, then print the  balance
  106.     of the line.  Since we put the printer in 12 CPI mode we needed to tell
  107.     CPRINT  that  88  characters  would fit on the print line so that input
  108.     lines longer than 72 characters would not be  needlessly  split.   This
  109.     effectively  centers an 80 character wide line on the 96 character wide
  110.     page with 8 character left and right margins.
  111.  
  112.  
  113.     The /S switch
  114.     -------------
  115.  
  116.     This  switch can be used in conjunction  with /1 and /2 to  control the
  117.     interleaving  of multiple  files  when  printing on both  sides of  the
  118.     paper. Suppose we have two files - FILEA containing 3 pages of data and
  119.     FILEB  containing 2 pages of data. If we wish to print on both sides of
  120.     the paper we can print the files with or without interleaving:
  121.  
  122.       Without /S
  123.       ----------
  124.  
  125.       CPRINT FILE? /1
  126.          then
  127.       CPRINT FILE? /2
  128.  
  129.       This will produce the following page layout:
  130.  
  131.         sheet 1 front side - page 1 of FILEA
  132.         sheet 1 back side  - page 2 of FILEA
  133.  
  134.         sheet 2 front side - page 3 of FILEA
  135.         sheet 2 back side  - page 1 of FILEB
  136.  
  137.         sheet 3 front side - page 2 of FILEB
  138.         sheet 3 back side  - blank
  139.  
  140.       Notice that page 3 of FILEA and page 1 of FILEB are printed on
  141.       opposite sides of the same peice of paper.
  142.  
  143.       With /S
  144.       -------
  145.  
  146.       CPRINT FILE? /S /1
  147.          then
  148.       CPRINT FILE? /S /2
  149.  
  150.       This will produce the following page layout:
  151.  
  152.         sheet 1 front side - page 1 of FILEA
  153.         sheet 1 back side  - page 2 of FILEA
  154.  
  155.         sheet 2 front side - page 3 of FILEA
  156.         sheet 2 back side  - blank
  157.  
  158.         sheet 3 front side - page 1 of FILEB
  159.         sheet 3 back side  - page 2 of FILEB
  160.  
  161.       Notice that each file is printed on a unique set of sheets.
  162.  
  163.  
  164.     Line Length
  165.     -----------
  166.  
  167.     CPRINT will start a new print line whenever a new line  is  encountered
  168.     in  the  input  file  OR  the  line length (as set by the /W switch) is
  169.     reached.  The program attempts to account for  non-printing  characters
  170.     when  making these decisions (embedded printer control codes).  This is
  171.     critical only when an input lines' length exceeds the  /W  line  length
  172.     due  to  embedded  control  codes.   CPRINT  does  NOT count any of the
  173.     following as printed characters when calculating printed line length:
  174.  
  175.             - Characters less than ASCII space (32)
  176.  
  177.             - ANY single character immediately following an
  178.               ASCII escape (27)
  179.  
  180.     For instance, if the physical line length is 84, the /W length  is  80,
  181.     and  the line contains two 2 character long printer control sequences -
  182.     the last four characters will NOT be printed on the next  line  because
  183.     CPRINT  understands that 4 of the characters were control codes and did
  184.     not move the printhead.  However, if the 84 character  long  line  does
  185.     not  contain  any  control  codes  then it will be split and the last 4
  186.     characters will be printed by themselves on the next  line.   There  is
  187.     one  situation  where  this  falls  flat  -  some printers have control
  188.     sequences composed of an ESCAPE  CHARACTER  FOLLOWED  BY  TWO  OR  MORE
  189.     NON-CONTROL CODE CHARACTERS.  For example:
  190.  
  191.        ESC A H
  192.  
  193.     This  will  be  considered  TWO  non-printed  characters  (ESC + single
  194.     character following it - A). Therefore CPRINT will think the  printhead
  195.     has moved right one character more than it actually has (due to the H).
  196.     The  /W  switch can be used to compensate accordingly.  I have found it
  197.     virtually impossible to build a program capable of interpreting all  of
  198.     the  various  control  code  sequences  used  by  all  of  the  printer
  199.     manufacturers.  I do not see this as a significant  problem  given  the
  200.     programs intent - to print source code and on-line documentation files.
  201.  
  202.  
  203.     Programmers Example
  204.     -------------------
  205.  
  206.     Given the following inputs:
  207.  
  208.       CPRINT PTD*.C /M8 /W88 /1
  209.          then
  210.       CPRINT PTD*.C /M8 /W88 /2
  211.  
  212.     CPRINT  printed  40 some files encompassing 115 pages with page breaks,
  213.     left margins for 3 hole punch, descriptive  file  information  as  page
  214.     headers,  and  correctly  interleaved on both sides of the 58 sheets of
  215.     paper.  Just like a book.  Need I say more?
  216.  
  217.  
  218.     Restrictions
  219.     ------------
  220.  
  221.           o  MS-DOS Version 2.0 or later is required.
  222.  
  223.  
  224.         CPRINT is supplied for personal, private use. Feel free to
  225.         distribute CPRINT given these restrictions:
  226.  
  227.           o  the program  shall be supplied in its original, unmodified
  228.              form, which includes this documentation and all other
  229.              files in the distribution list.
  230.  
  231.           o  no fee is charged.
  232.  
  233.           o  commmercial use is prohibited.
  234.  
  235.           o  the program may NOT be included - or bundled - with other
  236.              goods or services.
  237.  
  238.         If you  are using CPRINT and  find it of value, any contribution
  239.         would be greatly appreciated ($10 suggested).
  240.  
  241.  
  242.         Contributions and problem reports may be sent to:
  243.  
  244.  
  245.                Larry I.  Smith
  246.                808 Shenandoah Dr.
  247.                Plano, Texas 75023
  248.  
  249.  
  250.     Revision History
  251.     ----------------
  252.  
  253.           o  v3.9 - first public domain release.
  254.  
  255.           o  v4.0 - added support for embedded printer codes.
  256.  
  257.           o  v4.1 - corrected logic to handle lines containing
  258.                     an embedded CR. Some formatters use this
  259.                     method to emulate bold and underlining.
  260.  
  261.           o  v4.2 - internal housekeeping.
  262.  
  263.           o  v4.3 - corrected a bug associated with lines which
  264.                     start with a CR and contain more than the CR.
  265.  
  266.           o  v4.4 - replaced fopen/fprintf constructs with
  267.                     open/write constructs. some pc clone
  268.                     versions of MS-DOS 2.x do not always write
  269.                     to the printer correctly using fopen/fprintf.
  270.  
  271.                   - added CPRINTS.EXE to the archive. this is
  272.                     CPRINT.EXE with the full screen editor
  273.                     input feature removed so that users with
  274.                     non IBM compatible pc's won't crash their
  275.                     system trying to use the full screen mode.
  276.